package com.atguigu.spzx.cloud.order.feign;

import feign.RetryableException;
import feign.Retryer;

/**
 * projectName: com.atguigu.spzx.cloud.order.config
 * @author: 魏嘉禄
 * description: 
 * time: 2025/6/25 17:23
 */
public class FeignClientRetryer implements Retryer {

    private int start = 1;
    private int end = 3;

    @Override
    public void continueOrPropagate(RetryableException e) {
        if (start >= end) {
            throw new RuntimeException(e);
        }
        start++;
    }

    @Override
    public Retryer clone() {
        return new FeignClientRetryer();
    }
}
